package cn.edu.ctbu.sbadmin.grade.dao;


import cn.edu.ctbu.sbadmin.common.config.Constant;
import cn.edu.ctbu.sbadmin.common.core.MyMapper;
import cn.edu.ctbu.sbadmin.grade.domain.DimClassDO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/*
 * @description 
 * @param null
 * @author HighJ
 * @date 2022/4/13 9:51
 */

@Mapper
public interface DimClassDao extends MyMapper<DimClassDO> {

    @Select("SELECT\n" +
            "dim_class.id,\n" +
            "dim_class.class_name,\n" +
            "dim_class.total_num,\n" +
            "dim_class.grade_id,\n" +
            "dim_class.profession,\n" +
            "dim_graduation_project.grade_name\n" +
            "FROM\n" +
            "dim_class\n" +
            "INNER JOIN dim_graduation_project ON dim_graduation_project.id = dim_class.grade_id\n"+
            "${ew.customSqlSegment}")
    IPage<DimClassDO> selectPage(IPage<DimClassDO> page,
                                 @Param(Constants.WRAPPER)QueryWrapper<DimClassDO> queryWrapper);
}
